import java.io.Serializable;
import java.util.Iterator;
import java.util.LinkedList;

public class File implements Serializable{


	LinkedList<Requete> maFile;

	public File (){
		maFile = new LinkedList<Requete>();
	}
	public File (Requete r){
		maFile = new LinkedList<Requete>();
		maFile.addFirst(r);
	}
	public File (File f){
		maFile = new LinkedList<Requete>();
		ajouterFileEnQueue(f);
	}
	
	
	public LinkedList<Requete> getMaFile() {
		return maFile;
	}
	public void setMaFile(LinkedList<Requete> maFile) {
		this.maFile = maFile;
	}
	public void ajouterQueue(Requete c){
		maFile.addLast(c);
	}
	
	public Requete supprimerQueue(Requete c){
		return maFile.removeLast();
	}
	
	public Requete supprimerTete(){
		return maFile.removeFirst();
	}
	public Requete getTete(){
		return maFile.getFirst();
	}
	public boolean estVide(){
		return maFile.isEmpty();		
	}
    public void ViderFile(){
        maFile.clear();
    }
    public void ajouterFileEnQueue(File f){
    	Iterator<Requete> i = f.getMaFile().iterator();
    	while(i.hasNext()){
    		Requete r = i.next();
    		maFile.addLast(r);	
    	}
    }
    
    
    public String toString(){
    	String c="";
    	Iterator<Requete> i = maFile.iterator();
    	while(i.hasNext()){
    		Requete r = i.next();
    		c = r.toString();		
    	}
    	return c;
    }
    
    
    
}
